﻿<?php get_header(); ?>				

<div class="bg-content">
      <div class="container">      
    <div class="row">
          <div class="span12">  
        <!--============================== slider dsa  f=================================-->
        <?php 
					 wp_reset_query();
					 //$cat=get_category_by_slug('courses');
					$exlusiveid=array();
					 $args = array(
					 		'showposts'=>5,
							 'meta_key' => 'release',
							'orderby' => 'meta_value',
							'order' => 'DESC',
								 meta_query => array(
								        array(
								            'key' => 'banner',
								            'value' => '#',
								            'compare' => '>='
								        ),
								        array(
								            'key' => 'release',
								            'value' => gmdate('Y-m-d',time()+7*3600 + 150*24*3600),
								            'compare' => '<='
								        )
							        )
						);						
					 query_posts($args);
					 					
					?>
        <div class="flexslider">
              <ul class="slides">
              <?php while (have_posts()) : the_post(); $exlusiveid[]=get_the_ID();?>
            <li><a onclick="window.location='<?php echo get_permalink()?>'" href="<?php echo get_permalink()?>"> <img title="<?php the_title()?>" src="<?php echo get_site_url().post_custom('banner')?>" alt="<?php the_title()?>" ></a> </li>
            <?php endwhile;?>           
          </ul>
            </div>
        <span id="responsiveFlag"></span> 
       
      </div>
        </div>
  </div>
      
      <!--============================== content =================================-->
      
      <?php 
					 wp_reset_query();
					 //$cat=get_category_by_slug('courses');
					
					 $args = array(
					 	'showposts'=>4,
						'meta_key' => 'release',
						'orderby' => 'meta_value',
						'order' => 'DESC',
					 	'post__not_in'=>$exlusiveid,
						 meta_query => array(									       
									        array(
									            'key' => 'release',
									            'value' => gmdate('Y-m-d',time()+7*3600 + 90*24*3600),
									            'compare' => '<='
									        )
								        )
						);						
					 query_posts($args);
					 					
					?>
					
    <div class="row-1">
          <div class="container">
        <div class="row">
              <ul class="thumbnails thumbnails-1">
              
              <?php while (have_posts()) : the_post(); $exlusiveid[]=get_the_ID();?>
            <li class="span3">
                  <div class="thumbnail thumbnail-1">
             	<a href="<?php echo get_permalink()?>">
                <?php echo the_post_thumbnail('medium',array('style'=>'width:270px;','title'=>get_the_title(),'alt'=>get_the_title()) );?>
                </a>
                <section> <strong><h3><?php echo the_title()?></h3> </strong>
                      <p><?php echo wp_trim_words(get_the_content(),50)?></p>
                      <a href="<?php echo get_permalink()?>" class="btn btn-1">Chi tiết</a> </section>
              </div>
                </li>
                <?php endwhile;?>
            
          </ul>
            </div>
      </div>
        </div>
        
        
        <?php 
					 wp_reset_query();
					 //$cat=get_category_by_slug('courses');
					$i=0;
					 $args = array(
					 	'showposts'=>12,
						
						'orderby' => 'ID',
						'order' => 'DESC',
					 	'post__not_in'=>$exlusiveid,
					 /*
					 	'meta_key' => 'release',
						 meta_query => array(									       
									        array(
									            'key' => 'release',
									            'value' => gmdate('Y-m-d',time()+7*3600 + 90*24*3600),
									            'compare' => '<='
									        )
								        )
								        */
						);						
					 query_posts($args);
					 					
					?>
        
    <div class="container">
          <div class="row">
        <article class="span6">
              <ul class="list-photo">
              
              <?php while (have_posts()) : the_post();$i++; $exlusiveid[]=get_the_ID();
             
              
              ?>
              
            <li <?php if($i%4==0)echo 'class="last"'?>><a href="<?php echo the_permalink()?>" > <?php echo get_the_post_thumbnail(get_the_ID(),array(120,120),array('title'=>get_the_title()) );?></a></li>
            <?php endwhile;?>
            
          </ul>
            </article>
            
            
            
            
    <?php 
					 wp_reset_query();
					 //$cat=get_category_by_slug('courses');
					$i=0;
					 $args = array(
					 	'showposts'=>12,
						
						'orderby' => 'ID',
						'order' => 'DESC',
					 'post__not_in'=>$exlusiveid,
					 /*
					 	'meta_key' => 'rating',
					 	
						 meta_query => array(									       
									        array(
									            'key' => 'release',
									            'value' => gmdate('Y-m-d',time()+7*3600 + 90*24*3600),
									            'compare' => '<='
									        )
								        )
								        */
						);						
					 query_posts($args);
					 					
					?>         
        <article class="span6">
              <ul class="list-photo">
            <?php while (have_posts()) : the_post();$i++; //$exlusiveid[]=get_the_ID();
        
              
              ?>
              
            <li <?php if($i%4==0)echo 'class="last"'?>><a href="<?php echo the_permalink()?>"> <?php echo get_the_post_thumbnail(get_the_ID(),array(120,120),array('title'=>get_the_title()) );?></a></li>
            <?php endwhile;?>
          </ul>
            </article>
      </div>
        </div>
        <div class="keyword"><span>Từ khoá:</span>
	      	<h1>xem phim online mien phi</h1>
	      	<h2>xem phim cap toc mien phi</h2>
			<h2>xem phim mien phi</h2>
			<h2>xem phim moi nhat</h2>
			<h2>xem phim hay</h2>
			<h2>phim viet hay</h2>
			<h2>xem phim 2014</h2>
			<h2>xem phim 2015</h2>
			
					      	
	      </div>
	      <div class="clear20"></div>
  </div>
  
  
  
    </div>				
    
<?php get_footer(); ?>